package com.example.order_module;

import com.example.base.base.base1.BasePresenter;
import com.example.base.utils.LogUtil;
import com.example.network_lib.MyObserver;
import com.example.network_lib.RequestUtils;
import com.example.network_lib.module.OrderDetailBean;

/**
 * @author Administrator
 * @createTime 2019/10/6 20:39
 */
public class OrderDetailPresenter extends BasePresenter<IOrderDetailContract.View> implements IOrderDetailContract.Presenter {

    @Override
    public void getOrderDetail(String mobile, String sourceH5Code) {
        RequestUtils.getOrderDetail(mobile, sourceH5Code, ((OrderDetailActivity) mView), new MyObserver<OrderDetailBean>(((OrderDetailActivity) mView)) {
            @Override
            protected void onSuccess(OrderDetailBean result) {
                if (result != null) {
                    mView.getOrderDetailSuccess(result);
                }
            }

            @Override
            protected void onFailure(Throwable e, int code, String errMsg) {
                LogUtil.e(errMsg);
            }
        });
    }
}
